how to determine the domain and range of a function